﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using JobOffersBrowser.ViewModels;
using JobOffersBrowser.Views;

namespace JobOffersBrowser
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private MainViewModel mainVM;

        public MainWindow()
        {
            InitializeComponent();
            this.mainVM = new MainViewModel();
            this.DataContext = mainVM;
        }

        public void StatisticsMenu_Click(object sender, RoutedEventArgs e)
        {
            StatistictWindow statistics = new StatistictWindow();
            statistics.Show();
        }

        public void ExitMenu_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        public void MenuAdvancedSearchItem_Click(object sender, RoutedEventArgs e)
        {
            AdvancedSearchWindow advancedSearchWindow = new AdvancedSearchWindow();
            advancedSearchWindow.Show();
            this.Close();
        }

        private void Hyperlink_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                System.Diagnostics.Process.Start((e.OriginalSource as Hyperlink).NavigateUri.ToString());
            }
            catch
            {
            }
        }

        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {

        }
    }
}
